package com.hxk.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
/**
 * springboot异常处理方式三
 * 使用@ControllerAdvice+@ExceptionHandler处理系统中异常
 * @author Cactus
 */
@Controller
public class DemoController2 {

	@RequestMapping("/error1")
	public String error1() {
		String str = null;
		str.length();
		return "index";
	}
	
	@RequestMapping("/error2")
	public String error2() {
		int a = 10/0;
		return "index";
	}
}
